package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the CARE_TYPE database table.
 * 
 */
@Entity
@Table(name="CARE_TYPE")
@NamedQuery(name="CareType.findAll", query="SELECT c FROM CareType c")
public class CareType implements Serializable {
	public CareType(long careCategory, String careContain) {
		super();
		this.careCategory = careCategory;
		this.careContain = careContain;
	}

	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(initialValue=1,allocationSize=1,name="CARE_TYPE_CARECATEGORY_GENERATOR", sequenceName="SEQ_5")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CARE_TYPE_CARECATEGORY_GENERATOR")

	@Column(name="CARE_CATEGORY")
	private long careCategory;

	@Column(name="CARE_CONTAIN")
	private String careContain;

	//bi-directional many-to-one association to CustomerCare
	@OneToMany(mappedBy="careType")
	private List<CustomerCare> customerCares;

	public CareType() {
	}

	public long getCareCategory() {
		return this.careCategory;
	}

	public void setCareCategory(long careCategory) {
		this.careCategory = careCategory;
	}

	public String getCareContain() {
		return this.careContain;
	}

	public void setCareContain(String careContain) {
		this.careContain = careContain;
	}

	public List<CustomerCare> getCustomerCares() {
		return this.customerCares;
	}

	public void setCustomerCares(List<CustomerCare> customerCares) {
		this.customerCares = customerCares;
	}

	public CustomerCare addCustomerCare(CustomerCare customerCare) {
		getCustomerCares().add(customerCare);
		customerCare.setCareType(this);

		return customerCare;
	}

	public CustomerCare removeCustomerCare(CustomerCare customerCare) {
		getCustomerCares().remove(customerCare);
		customerCare.setCareType(null);

		return customerCare;
	}


}